<?php
/**
 * Widget for displaying content on home page
 *
 * Used for both single and index/archive/search.
 *
 * @package WordPress
 * @subpackage lebanontimes
 * @since Lebanon Times 1.0
 */

include dirname(__FILE__)."/categoryMapping.php";
?>
<div class="widget widgetMargin">
    <div class="tabActive">
        <a href="<?php echo get_category_link( $categoryMapping['interview'][0] );?>"><?php echo get_the_category_by_ID( $categoryMapping['interview'][0] );?></a>
    </div>
    <div class="content" style="height: 130px;">
        <ul>
            <?php 
                $posts = get_posts("category={$categoryMapping['interview'][0]}&numberposts=0");
                for($i=0;$i<$categoryMapping['interview'][1];$i++) {
                                $post = $posts[$i];
            ?>
            <li>
                <p>
                    <a class="a-wp-post-image" href="<?php the_permalink() ?>" target="_parent">
                        <?php the_post_thumbnail( array(120,120) ); ?>
                        <?php the_title(); ?>
                    </a>
                </p>
            </li>
            <?php } ?>
        </ul>
    </div>
</div>